home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Turnbull China Bikeride
/
Turnbull China Bikeride - Disc 2.iso
/
STUTTGART
/
LANG
/
C
/
LIB
/
YLIB
/
ylib_0_10
/
Readme
< prev
next >
Wrap
Text File
|
1993-09-21
|
4KB
|
109 lines
Program: ylib
Purpose: speed-up of math operations.
Author: Claus Vohwinkel
E-mail: vohwinkel@vxdesy.desy.de
Version: ylib version 0.10
Required: FPA10
Machines: It has been compiled and run in the following environment:
Acorn 410/1 4Mb ram FPA10
FPemulator 4.01
CC version 4.0 Clib version 3.99
ylib is a package of routines which will speed up most of the math functions
by a factor of about 3.
ylib comes in 2 flavours.
The first one is the object library O.YLIB_OBJ, which should be used with
the header file ymath.h.
ylib_obj.o defines routines ysin,ycos,... . By default, the header file
sets up macros to translate sin to ysin etc. You can disable this translation
by using
#define no_y_trans
before including ymath.h
ylib_obj contains 2 routines which are not available in the other version,
namely exm1, which computes exp(x)-1, taking care of loss of significance
for x around 0,
and twotox which computes 2**x.
The second version of ylib is the module YLIB_MOD, which hacks its way into the
Shared CLibrary by intercepting the SWIs which are used to link the
Library to an application. This is the preferred way of using ylib cause
the decision whether the ylib routines are used is made at run-time.
ylib_mod must be loaded after the CLib.
To take full adavantage of ylib you should modify the math.h header file.
It contains #defines to map some functions to inline functions, which
will then be emulated rather slowly.
In my version of the C compiler (4.0) these are
atan, sin and cos and fabs.
You should delete the defines for atan,sin and cos, but NOT for fabs.
Further you have to include the math file by
#include "math.h"
rather than by
#include <math.h>
cause in the second case the compiler will use an internal file.
If you do not do this changes no harm is done, but atan, sin and cos will
remain slow.
(if you use the changed header file and do not use ylib,
sin,cos and atan will be about 10 percent slower than usual)
Once the module is loaded the module name is FastMath.
It provides a command
FastMath [-on|-off] [-verbose].
Fastmath without parameters returns the current status.
With -on or -off you control whether applications are linked with the ylib
routines or with the CLib routines.
If you specify -verbose a message is printed each time an application is
linked with ylib.
Currently the module refuses to die, after it has been linked at least once
to an application (it has no way of telling if the application is still active).
-------------------------------------------------------------------------
While some routines are homemade, most of them are based on:
John F. Hart et. al.
Computer Approximations
John Wiley & Sons, Inc., New York, London, Sidney
1968
--------------------------------------------------------------------------
Further comments:
ylib is not intended to be used in supervisor mode.
The ylib_mod version does not link modules to the ylib routines.
I think that for some routines and arguments Nan,inf,minf there is
some severe degradation of performance.
The handling of NaNs might be not quite correct, in that sense that
a different than the original NaN is returned.
Don't ask me why I called the whole thing ylib...
--------------------------------------------------------------
Copyright (C) 1993 Claus Vohwinkel
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License , or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
You may contact the author by:
e-mail: vohwinkel@vxdesy.desy.de
us-mail: Claus Vohwinkel
SCRI/FSU
400 Science Library
Tallahassee, FL 32306